<template>
  <uni-nav-bar title="合作伙伴账号" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
  <view class="package space-between" v-for="item in getAdmin" :key='item.id'
    @click="navTo('administrator/accountNumber/accountDeatil?id='+item.id)">
    <view>{{item.nickname}}（{{item.id}}）</view>
    <view>{{item.mobile}}</view>
  </view>
</template>

<script setup lang="ts">
  import { navBack, navTo } from '@/utils/navigator';
  import { ref } from 'vue';
  import { toPublish } from '@mqtt';
  import { getAdmins } from '@/gql/administrator';
  import { showLoading } from '@/utils/prompt';
  const getAdmin = ref()
  /**
   * 获取合作伙伴账号列表
   */
  init()
  function init() {
    showLoading()
    const payload = {
      query: getAdmins,
    };
    toPublish(
      'ql/control/getAdminList',
      payload,
      (obj : any) => {
        uni.hideLoading();
        const { getAdminList } = obj.data;
        getAdmin.value = getAdminList
      }
    );
  }
</script>

<style scoped lang="less">
</style>